From: Ben Hutchings Date: Mon, 7 Sep 2020 01:51:53 +0000 (+0100) Subject: Export symbols needed by Android drivers X-Git-Tag: archive/raspbian/6.12.27-1+rpi1^2^2^2^2^2^2^2^2^2^2^2^2^2^2^2^2^2^2^2^2^2^2^2^2^2^2^2~66 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/%22bookmarks://%22/%22http:/www.example.com/cgi/%22https:/%22bookmarks:/%22?a=commitdiff_plain;h=79db6ae3302dcdef695d78b75cee1fc9450f96c2;p=linux.git Export symbols needed by Android drivers Bug-Debian: https://bugs.debian.org/901492 We want to enable use of the Android ashmem and binder drivers to support Anbox, but they should not be built-in as that would waste resources and increase security attack surface on systems that don't need them. Export the currently un-exported symbols they depend on. Gbp-Pq: Topic debian Gbp-Pq: Name export-symbols-needed-by-android-drivers.patch --- diff --git a/fs/file.c b/fs/file.c index 5fb0b146e79..e2d480011bf 100644 --- a/fs/file.c +++ b/fs/file.c @@ -819,6 +819,7 @@ struct file *close_fd_get_file(unsigned int fd) return file; } +EXPORT_SYMBOL_GPL(close_fd_get_file); void do_close_on_exec(struct files_struct *files) { diff --git a/kernel/sched/core.c b/kernel/sched/core.c index a708d225c28..96b0ed560a7 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -7279,6 +7279,7 @@ static bool is_nice_reduction(const struct task_struct *p, const int nice) return (nice_rlim <= task_rlimit(p, RLIMIT_NICE)); } +EXPORT_SYMBOL_GPL(can_nice); /* * can_nice - check if a task can reduce its nice value diff --git a/kernel/sched/wait.c b/kernel/sched/wait.c index 51e38f5f470..8b3547706b0 100644 --- a/kernel/sched/wait.c +++ b/kernel/sched/wait.c @@ -212,6 +212,7 @@ void __wake_up_pollfree(struct wait_queue_head *wq_head) /* POLLFREE must have cleared the queue. */ WARN_ON_ONCE(waitqueue_active(wq_head)); } +EXPORT_SYMBOL_GPL(__wake_up_pollfree); /* * Note: we use "set_current_state()" _after_ the wait-queue add, diff --git a/kernel/task_work.c b/kernel/task_work.c index 95a7e1b7f1d..972c3280337 100644 --- a/kernel/task_work.c +++ b/kernel/task_work.c @@ -73,6 +73,7 @@ int task_work_add(struct task_struct *task, struct callback_head *work, return 0; } +EXPORT_SYMBOL_GPL(task_work_add); /** * task_work_cancel_match - cancel a pending work added by task_work_add() diff --git a/mm/memory.c b/mm/memory.c index ec7b775fb43..5cafae6ffb0 100644 --- a/mm/memory.c +++ b/mm/memory.c @@ -1780,6 +1780,7 @@ void zap_page_range_single(struct vm_area_struct *vma, unsigned long address, tlb_finish_mmu(&tlb); hugetlb_zap_end(vma, details); } +EXPORT_SYMBOL_GPL(zap_page_range_single); /** * zap_vma_ptes - remove ptes mapping the vma diff --git a/mm/shmem.c b/mm/shmem.c index fb2daf89e2f..fae50899985 100644 --- a/mm/shmem.c +++ b/mm/shmem.c @@ -4888,6 +4888,7 @@ int shmem_zero_setup(struct vm_area_struct *vma) return 0; } +EXPORT_SYMBOL_GPL(shmem_zero_setup); /** * shmem_read_folio_gfp - read into page cache, using specified page allocation flags. diff --git a/security/security.c b/security/security.c index 2cfecdb054c..7b11be16664 100644 --- a/security/security.c +++ b/security/security.c @@ -799,6 +799,7 @@ int security_binder_set_context_mgr(const struct cred *mgr) { return call_int_hook(binder_set_context_mgr, 0, mgr); } +EXPORT_SYMBOL_GPL(security_binder_set_context_mgr); /** * security_binder_transaction() - Check if a binder transaction is allowed @@ -814,6 +815,7 @@ int security_binder_transaction(const struct cred *from, { return call_int_hook(binder_transaction, 0, from, to); } +EXPORT_SYMBOL_GPL(security_binder_transaction); /** * security_binder_transfer_binder() - Check if a binder transfer is allowed @@ -829,6 +831,7 @@ int security_binder_transfer_binder(const struct cred *from, { return call_int_hook(binder_transfer_binder, 0, from, to); } +EXPORT_SYMBOL_GPL(security_binder_transfer_binder); /** * security_binder_transfer_file() - Check if a binder file xfer is allowed @@ -845,6 +848,7 @@ int security_binder_transfer_file(const struct cred *from, { return call_int_hook(binder_transfer_file, 0, from, to, file); } +EXPORT_SYMBOL_GPL(security_binder_transfer_file); /** * security_ptrace_access_check() - Check if tracing is allowed